//
//  CollectionFaceScoreViewCell.swift
//  StudyDY
//
//  Created by yinchangming on 2018/7/4.
//  Copyright © 2018年 yinchangming. All rights reserved.
//

import UIKit
import Kingfisher
//颜值cell
class CollectionFaceScoreViewCell: UICollectionViewCell {
    @IBOutlet weak var locationBtn: UIButton!
    
    @IBOutlet weak var onLinesLabel: UILabel!
    @IBOutlet weak var nikeNameLabel: UILabel!
    @IBOutlet weak var faceBackImag: UIImageView!
    var room:RoomList?{
        didSet{
//            faceBackImag.kf.setImage(with: ImageResource(downloadURL: URL(string: (room?.vertical_src)!)!))
            ImageTools.showImage(image: faceBackImag, url:  URL(string: (room?.vertical_src)!)!)
            locationBtn.setTitle(room?.anchor_city, for: .normal)
            nikeNameLabel.text=room?.nickname
            let persons=room?.online
            var showPersonStr=""
            if(persons! >= 10000){
                showPersonStr="\(Int( persons! / 10000)) 人在线"
            }else {
                showPersonStr="\(persons!) 人在线"
            }
            onLinesLabel.text=showPersonStr
        }
    }
 
}
